package cn.com.selfsoft.smartcity.core.controller;

import cn.com.selfsoft.smartcity.commons.http.DataItem;
import cn.com.selfsoft.smartcity.commons.http.DataList;
import cn.com.selfsoft.smartcity.commons.http.DataPage;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.http.ResponseEntity;

import javax.servlet.http.HttpServletRequest;

/**
 *
 *
 */
public abstract class GenericControllerImpl<T, K> implements GenericController<T, K> {

	@Override
	public ResponseEntity<Long> count(HttpServletRequest request) {
		throw new UnsupportedOperationException("operation count is unsupported");
	}

	@Override
	public ResponseEntity<DataPage> page(HttpServletRequest request, Pageable page) {
		throw new UnsupportedOperationException("operation page is unsupported");
	}

	@Override
	public ResponseEntity<DataList> list(HttpServletRequest request, Sort sort) {
		throw new UnsupportedOperationException("operation list is unsupported");
	}

	@Override
	public ResponseEntity<DataItem> load(K id, HttpServletRequest request) {
		throw new UnsupportedOperationException("operation load is unsupported");
	}

	@Override
	public ResponseEntity<Void> delete(K id, HttpServletRequest request) {
		throw new UnsupportedOperationException("operation delete is unsupported");
	}

	@Override
	public ResponseEntity<DataItem> create(T entity, HttpServletRequest request) {
		throw new UnsupportedOperationException("operation create is unsupported");
	}

	@Override
	public ResponseEntity<DataItem> update(K id, T entity, HttpServletRequest request) {
		throw new UnsupportedOperationException("operation update is unsupported");
	}

}
